-
Notifications
You must be signed in to change notification settings - Fork 172
overlay.d & tests: Add alternatives migration and test and remove iptables-legacy #3253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overlay.d & tests: Add alternatives migration and test and remove iptables-legacy #3253
Conversation
484d98b
to
2ba6b2a
Compare
086b0fa
to
273dbde
Compare
I've now added the migration script to this PR and a test for it. Not fully tested yet. |
overlay.d/50alternatives/usr/libexec/coreos-alternatives-migration
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM.
273dbde
to
3cfd61b
Compare
3cfd61b
to
6c31ebb
Compare
This test was failing after rpm-ostree update including coreos/rpm-ostree#5368. Updated the path to |
6c31ebb
to
193cb37
Compare
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the first time I come across the use of alternatives
for iptables, regardless...
/lgtm
overlay.d/50alternatives/usr/libexec/coreos-alternatives-migration
Outdated
Show resolved
Hide resolved
overlay.d/50alternatives/usr/libexec/coreos-alternatives-migration
Outdated
Show resolved
Hide resolved
overlay.d/50alternatives/usr/libexec/coreos-alternatives-migration
Outdated
Show resolved
Hide resolved
overlay.d/50alternatives/usr/systemd/system/coreos-alternatives-migration.service
Outdated
Show resolved
Hide resolved
d21d435
to
3f4040d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good. A few comments (mostly clarifying questions).
I really don't feel comfortable merging this without a review from @travier though. He should be back next week I think.
overlay.d/50alternatives/usr/lib/systemd/system/coreos-alternatives-migration.service
Outdated
Show resolved
Hide resolved
overlay.d/50alternatives/usr/systemd/system/coreos-alternatives-migration.service
Outdated
Show resolved
Hide resolved
3f4040d
to
5034859
Compare
overlay.d/50alternatives/usr/lib/systemd/system/coreos-alternatives-migration.service
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the changes from #3573 here as well? Thanks
overlay.d/50alternatives/usr/lib/systemd/system-preset/50-alternatives-migration.preset
Outdated
Show resolved
Hide resolved
b3880ed
to
177b6aa
Compare
Added it here and closed the other PR. |
Let's squash the last two commits together. Also there is some post script we should clean up. Let's just leave the changes all in fedora-coreos-base and add a new conditional_include in there? Suggestion: diff --git a/manifests/fedora-coreos-base.yaml b/manifests/fedora-coreos-base.yaml
index 05b2927a..98e7b24b 100644
--- a/manifests/fedora-coreos-base.yaml
+++ b/manifests/fedora-coreos-base.yaml
@@ -27,6 +27,28 @@ ostree-layers:
- overlay/25azure-udev-rules
- overlay/30lvmdevices
+conditional-include:
+ - if: releasever < 43
+ include:
+ packages:
+ # iptables-legacy was in <43 but excluded from 43+
+ # https://github.com/coreos/fedora-coreos-tracker/issues/1818
+ - iptables-legacy
+ postprocess:
+ # Default to iptables-nft. Otherwise, legacy wins. We can drop this once/if we
+ # remove iptables-legacy. This is needed because alternatives don't work
+ # https://github.com/coreos/fedora-coreos-tracker/issues/677
+ # https://github.com/coreos/fedora-coreos-tracker/issues/676
+ - |
+ #!/usr/bin/bash
+ set -eux -o pipefail
+ ln -sf /usr/sbin/ip6tables-nft /etc/alternatives/ip6tables
+ ln -sf /usr/sbin/ip6tables-nft-restore /etc/alternatives/ip6tables-restore
+ ln -sf /usr/sbin/ip6tables-nft-save /etc/alternatives/ip6tables-save
+ ln -sf /usr/sbin/iptables-nft /etc/alternatives/iptables
+ ln -sf /usr/sbin/iptables-nft-restore /etc/alternatives/iptables-restore
+ ln -sf /usr/sbin/iptables-nft-save /etc/alternatives/iptables-save
+
# Be minimal
recommends: false
@@ -71,20 +93,6 @@ postprocess:
set -eux -o pipefail
systemctl mask dnsmasq.service
- # Default to iptables-nft. Otherwise, legacy wins. We can drop this once/if we
- # remove iptables-legacy. This is needed because alternatives don't work
- # https://github.com/coreos/fedora-coreos-tracker/issues/677
- # https://github.com/coreos/fedora-coreos-tracker/issues/676
- - |
- #!/usr/bin/bash
- set -eux -o pipefail
- ln -sf /usr/sbin/ip6tables-nft /etc/alternatives/ip6tables
- ln -sf /usr/sbin/ip6tables-nft-restore /etc/alternatives/ip6tables-restore
- ln -sf /usr/sbin/ip6tables-nft-save /etc/alternatives/ip6tables-save
- ln -sf /usr/sbin/iptables-nft /etc/alternatives/iptables
- ln -sf /usr/sbin/iptables-nft-restore /etc/alternatives/iptables-restore
- ln -sf /usr/sbin/iptables-nft-save /etc/alternatives/iptables-save
-
# sudo prefers its config files to be mode 440, and some security scanners
# complain if /etc/sudoers.d files are world-readable.
# https://bugzilla.redhat.com/show_bug.cgi?id=1981979
@@ -164,9 +172,6 @@ packages:
- console-login-helper-messages-motdgen
# i18n
- kbd
- # In F35+ need `iptables-legacy` package
- # See https://github.com/coreos/fedora-coreos-tracker/issues/676#issuecomment-928028451
- - iptables-legacy
# NIC firmware we've traditionally shipped but then were split out of linux-firmware in Fedora
- qed-firmware # https://github.com/coreos/fedora-coreos-tracker/issues/1746
# Include udev rules for NVMe backed Azure Instances |
Including the alternates overlay changes too? @dustymabe |
No sorry.. Just the last commit where we are moving the iptables-legacy package (and also the postprocess for setting nft as the default, which won't be needed once we remove the legacy package). |
a9e89b5
to
15a7ba7
Compare
Ok. Updated. |
This LGTM, but now the alternatives test (that we are also adding in this PR) can't do the full test because there is no iptables-legacy to set it back to so we can test the migration. Not sure what to do about that. Maybe we'll just have to settle for some manual testing? |
We can probably do the same verification as we do in the extended upgrade test. I guess the upgrade test needs to be updated as well to do the verification if release version is >= 43 |
We can overlay the package and apply live in the test as well. |
15a7ba7
to
47c677f
Compare
Modified the alternatives test to skip on version before 43 and overlay iptables-legacy. |
47c677f
to
2c605de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this should be good for F43 now. Thanks Bipin!
Requesting an (hopefully) final review from @dustymabe :) |
|
- Add an overlay with the migration logic for alternatives - Add a test for the migration script This should make sure that the system is setup properly and that the migration script will do the right thing on older systems. See: coreos/fedora-coreos-tracker#1818 See: coreos/fedora-coreos-tracker#677 See: https://docs.fedoraproject.org/en-US/fedora-coreos/alternatives/ co-authored by: Bipin B Narayan <[email protected]>
2c605de
to
4f83d04
Compare
Fixed it. @dustymabe , can you take a final look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
overlay.d: Add empty statoverride config files
overlay.d & tests: Add alternatives migration and test
This should make sure that the system is setup properly and that the
migration script will do the right thing on older systems.
See: coreos/fedora-coreos-tracker#1818
See: coreos/fedora-coreos-tracker#677
See: https://docs.fedoraproject.org/en-US/fedora-coreos/alternatives/